<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<meta name="SiteName" content="北京市人力资源和保障局门户网站">
	<meta name="SiteDomain" content=" rsj.beijing.gov.cn">
	<meta name="SiteIDCode" content="1100000062">
	<meta name="ColumnName" content="最新招聘信息">
	<meta name="ColumnType" content="机构职能">
	<meta name="ColumnDescription" content="最新招聘信息列表展示">
	<meta name="ColumnKeywords" content="单位行业,岗位类别">
	<title>最新招聘信息</title>
	<link rel="stylesheet" href="./styles/css/common.css">
</head>

<body>
	<div class="bgc">
	<!-- 公共顶部 -->
	<script src="http://rsj.beijing.gov.cn/header.js"></script>
		<!-- 2.就业超市 -->
		<!-- 头部 -->
		<div class="job_header" style="margin-bottom:0">
			<div class="job_header_con clearfix">
				<a href="./index.html" class="left">
					<img src="./styles/images/logo.png" alt="">
				</a>
				<span class="left zxxx_fontimg" style="width:300px"></span>
			</div>
		</div>
	</div>
	<!-- 3.广告 -->
	<div class="byszc_banner">
		<img src="./styles/images/zxhd.png" alt="">
	</div>
	<!-- 首页招聘信息 -->
	<div class="home_recruit" style="margin-top: 20px;">
		<div class="recruit_title clearfix">
			<div class="recruit_left left">
				<i></i>
				<span>最新招聘信息</span>
				<select class="recruit_city">
					<option value="">北京市</option>
				</select>
			</div>
			<div class="recruit_fl left">
				<div class="detail_fl">
					<span>单位行业</span>
					<i></i>
				</div>
				<div class="show_fl">
					<a href="javascript:void(0);" class="fl_gwlb fl_active" dmflag='1'>单位行业</a>
					<a href="javascript:void(0);" class="fl_dwhy" dmflag='2'>岗位类别</a>
				</div>
			</div>
			<div class="recruit_center left">
				<!-- <a href="javascript:void(0)" class="r_active" dmid="">全部</a> -->
			</div>
			<div class="recruit_center2 left" style="display: none">
				<!-- <a href="javascript:void(0)" class="r_active" dmid="">全部</a> -->
			</div>
			<div class="recruit_right right">
				换一批
			</div>
		</div>
		<div class="recruit_con J_new_zp clearfix" id="j_area">
			<script type="text/html" id="J_item">
					<%if(+data.executeResult == 1){%>
						<%var _data = data.data%>
						<%if(_data.length > 0){%>
							<%for(var i=0;i<_data.length;i++){%>
							<a href="javascript:void(0);" dmid="<%=_data[i ].id%>">
								<div class="rec_top clearfix">
									<span class="zw_goin">查看详情</span>
									<p class="zw_name" title="<%=_data[i].gwmc%>"><%=_data[i].gwmc%></p>
									<!-- <span class="zw_price"><%=_data[i].gwgz%></span> -->
								</div>
								<div class="rec_bottom clearfix">
									<img src="./styles/images/companylogo.png" alt="">
									<p class="com_name" title="<%=_data[i].zpdwmc%>"><%=_data[i].zpdwmc%></p>
								</div>
							</a>
							<%}%>
						<%}else{%>
						<p class="zwzpxx">暂无招聘信息</p>
						<%}%>
					<%}%>
				</script>
		</div>
	</div>
	<script src="http://rsj.beijing.gov.cn/footer.js"></script>

	<script src="./common/vendor.js"></script>
	<script src="./common/md5_32.js"></script>
	<script src="./common/configuration.js"></script>
	<script src="./common/common.js"></script>
	<script>
		$(function () {
			var loading = new $.Loading();
			//初始值pagenum
			var hy_arr = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
			var lb = '1'; //行业类别 ：岗位类别 单位行业
			$('.service_nav .nav_li').hover(function () {
				$('.service_nav .nav_li').removeClass('s_active');
				$(this).addClass('s_active').find('.ser_list').show();
				$(this).siblings('.nav_li').find('.ser_list').hide();
			}, function () {
				$(this).removeClass('s_active').find('.ser_list').hide();
			});
			$('.comp_other').hover(function () {
				$(this).find('.com_sub').show();
			}, function () {
				$(this).find('.com_sub').hide();
			});
			//招聘信息点击事件
			// 获取工作地区
			get_qu();
			// 获取行业
			get_hy();
			function get_qu() {
				$.fetch({
					url: '/zxzpxx/gzdqCx',
					type: 'get'
				}).done(function (res) {
					var _data = res.returnData.gzdq;
					if (+_data.executeResult === 1) {
						var _html = '';
						$.each(_data.data, function (k, v) {
							_html += '<option dmid="' + v.dmid + '" value="' + v.dmid + '" title="' + v.dmmc + '">' + v.dmmc + '</option>'
						});
						$('.recruit_city').append(_html);
					} else {
						$.layerMsg(res.returnData.gzdq.message, '我知道了', function () {
							return false;
						});
					}
				});
			}
			// 获取行业
			function get_hy() {
				$.fetch({
					url: '/zxzpxx/sshyCx',
					type: 'get'
				}).done(function (res) {
					var _data = res.returnData;
					if (+_data.executeResult === 1) {
						var _html = '';
						var firstdmid = '';
						$.each(_data.data[0].xx, function (k, v) {
							if (k == 0) {
								firstdmid = v.id;
								_html += '<a href="javascript:void(0)" dmindex="' + k + '" dmid="' + v.id + '" class="r_active">' + v.name + '</a>'
							} else {
								_html += '<a href="javascript:void(0)" dmindex="' + k + '" dmid="' + v.id + '">' + v.name + '</a>'
							}
						});

						$('.recruit_center').append(_html);
						var _html2 = '';
						$.each(_data.data[1].xx, function (k, v) {
							_html2 += '<a href="javascript:void(0)" dmindex="' + (_data.data[0].xx.length + k) + '" dmid="' + v.id + '">' + v.name + '</a>'
						});
						$('.recruit_center2').append(_html2);


						// 首次加载数据
						get_zp_mes('', firstdmid);
					} else {
						$.layerMsg(_data.message, '我知道了', function () {
							return false;
						});
					}
				});
			}
			// 获取招聘信息
			// get_zp_mes();
			/**
			 * @desc 招聘信息查询功能
			 * @param {String} xzqh 行政区划
			 * @param {String} hylb 行业类别 dmid
			 * @param {Number} pageNum 第几页
			 * @param {Number} _num 数据存放多少页
			 * @param {String} lb 类别
			 * @param {String} zygz 专业工种
			 * */
			function get_zp_mes(xzqh, hylb, pageNum, _num, lb, zygz) {
				var _xzqh = xzqh || '';
				var _hylb = hylb || '';
				var _pageNum = pageNum || 1;
				var _lb = lb || 1;
				var _zygz = zygz || '';
				loading.on()
				$.asyncRender({
					url: '/zxzpxx/xxCx',
					type: 'post',
					data: {
						xzqh: _xzqh,
						hylb: _hylb,
						pageSize: 20,
						pageNum: _pageNum,
						lb: _lb,
						zygz: _zygz
					},
					wrap: '#j_area',
					tem: '#J_item',
					pos: 'returnData',
				}).always(function () {
					loading.off();
				}).done(function (res) {
					var data = res.returnData;
					if (+data.executeResult === 1) {
						if (+data.sfcz === 1) {
							hy_arr[_num] = 1;
						}
						if (data.hyp == '') {
							$('.recruit_right').hide();
						} else {
							$('.recruit_right').show();
						}
					} else {
						$.layerMsg(data.message, '我知道了', function () {
							return false;
						});
					}
				})
			}
			// hover事件
			$('.recruit_fl ').hover(function () {
				$('.recruit_fl .show_fl').show();
			}, function () {
				$('.recruit_fl .show_fl').hide();
			})
			// 点击岗位类别
			$(document).on('click', '.show_fl a', function () {
				$('.show_fl a').removeClass('fl_active');
				$(this).addClass('fl_active');
				$('.detail_fl span').text($(this).text());
				$('.show_fl').hide();
				if ($(this).attr('dmflag') == 1) {
					$('.recruit_center').show();
					$('.recruit_center2').hide();
					$('.recruit_center a').eq(0).click();
				} else {
					$('.recruit_center').hide();
					$('.recruit_center2').show();
					$('.recruit_center2 a').eq(0).click();
				}
			})

			// 点击换一批切换数据
			$(document).on('click', '.recruit_right', function () {
				var xzqh = $('.recruit_city option:selected').attr('value');
				var hylb = '';
				var _num = 0;
				if ($('.recruit_center').css('display') == 'none') {
					$('.recruit_center2 a').each(function (k, v) {
						if ($(v).attr('class') == 'r_active') {
							hylb = $(v).attr('dmid');
							_num = $(v).attr('dmindex');
							hy_arr[_num] = hy_arr[_num] + 1;
							get_zp_mes(xzqh, hylb, hy_arr[_num], _num, 2, hylb);
						}
					});
				} else {
					$('.recruit_center a').each(function (k, v) {
						if ($(v).attr('class') == 'r_active') {
							hylb = $(v).attr('dmid');
							_num = $(v).attr('dmindex');
							hy_arr[_num] = hy_arr[_num] + 1;
							get_zp_mes(xzqh, hylb, hy_arr[_num], _num);
						}
					});
				}

			});
			// 点击行业行业切换数据
			$(document).on('click', '.recruit_center a', function () {
				$('.recruit_center a').removeClass('r_active');
				$(this).addClass('r_active');
				var xzqh = $('.recruit_city option:selected').attr('value');
				var hylb = $(this).attr('dmid');
				var pageNum = hy_arr[$(this).attr('dmindex')];
				var _num = $(this).attr('dmindex');
				get_zp_mes(xzqh, hylb, pageNum, _num);
			});
			// 点击岗位类别切换数据
			$(document).on('click', '.recruit_center2 a', function () {
				$('.recruit_center2 a').removeClass('r_active');
				$(this).addClass('r_active');
				var xzqh = $('.recruit_city option:selected').attr('value');
				var hylb = $(this).attr('dmid');
				var pageNum = hy_arr[$(this).attr('dmindex')];
				var _num = $(this).attr('dmindex');
				get_zp_mes(xzqh, hylb, pageNum, _num, 2, hylb);
			});
			$(document).on('click', '.J_new_zp a', function () {
				var dmid = $(this).attr('dmid');
				viewNum('1900003');//点击招聘单位
				window.open('./job.html?dmid=' + dmid + '&flag=1');
			});
			// 改变工作地区
			$('.recruit_city').change(function () {
				var xzqh = $('.recruit_city option:selected').attr('value');
				var hylb = '';
				var _num = 0;
				if ($('.recruit_center').css('display') == 'none') {
					$('.recruit_center2 a').each(function (k, v) {
						if ($(v).attr('class') == 'r_active') {
							hylb = $(v).attr('dmid');
							_num = $(v).attr('dmindex');
							hy_arr = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
							get_zp_mes(xzqh, hylb, '', '', 2, hylb);
						}
					});
				} else {
					$('.recruit_center a').each(function (k, v) {
						if ($(v).attr('class') == 'r_active') {
							hylb = $(v).attr('dmid');
							_num = $(v).attr('dmindex');
							hy_arr = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
							get_zp_mes(xzqh, hylb, '', '', 1);
						}
					});
				}

			});
		});
	</script>
</body>

</html>
